package com.doit

object _01_wordCount {
  def main(args: Array[String]): Unit = {
    val list: List[String] = List("hello,hello,hello", "hello,hi,hi", "hi,hi,hi")
    list.flatMap(_.split(","))
      .groupBy(word=>word)
      .map(tp=>(tp._1,tp._2.size))
      .foreach(println)
  }

}
